package cn.com.shopec.erp.system.service;

import java.util.List;

import cn.com.shopec.erp.common.page.PageFinder;
import cn.com.shopec.erp.common.page.PageQuery;
import cn.com.shopec.erp.system.entity.Role;
import cn.com.shopec.erp.system.vo.RoleVo;
import cn.com.shopec.erp.system.vo.UserVo;

/**
 * 
 * @ClassName IRoleService
 * @Description 角色Service
 * @author chengui
 * @date 2013-5-30 上午11:00:10
 */
public interface IRoleService {
	
	/**
	 * 
	 * @MethodName getPagedRoleVos
	 * @Description 获得分页后的角色Vo集合
	 * @author chengui
	 * @date 2013-5-30 下午4:48:50
	 * @param roleVo
	 * @param pageQuery
	 * @return PageFinder<RoleVo>
	 * @throws Exception
	 */
	public PageFinder<RoleVo> getPagedRoleVos(RoleVo roleVo, PageQuery pageQuery) throws Exception;
	
	/**
	 * 
	 * @MethodName addRole
	 * @Description 新增角色
	 * @author chengui
	 * @date 2013-5-30 下午6:37:49
	 * @param userVo
	 * @throws Exception
	 */
	public void addRole(RoleVo roleVo) throws Exception;
	
	/**
	 * 
	 * @MethodName roleCodeExist
	 * @Description 检查角色编码是否已经存在
	 * @author chengui
	 * @date 2013-5-30 下午6:51:31
	 * @param roleVo
	 * @return String
	 * @throws Exception
	 */
	public String roleCodeExist(RoleVo roleVo) throws Exception;
	
	/**
	 * 
	 * @MethodName getRoleVo
	 * @Description 获得供应链单个角色Vo
	 * @author chengui
	 * @date 2013-5-30 下午7:10:50
	 * @param roleVo
	 * @return RoleVo
	 * @throws Exception
	 */
	public RoleVo getRoleVo(RoleVo roleVo) throws Exception;
	
	/**
	 * 
	 * @MethodName modifyRole
	 * @Description 修改供应链角色
	 * @author chengui
	 * @date 2013-5-30 下午7:33:18
	 * @param roleVo
	 */
	public void modifyRole(RoleVo roleVo) throws Exception;
	
	/**
	 * 
	 * @MethodName deleteRole
	 * @Description 删除角色
	 * @author chengui
	 * @date 2013-5-30 下午7:39:27
	 * @param roleVo
	 * @throws Exception
	 */
	public void deleteRole(RoleVo roleVo) throws Exception;
	
	/**
	 * 
	 * @MethodName getAllRoleVo
	 * @Description 获得所有的角色Vo
	 * @author chengui
	 * @date 2013-5-30 下午8:20:54
	 * @return List<RoleVo>
	 * @throws Exception
	 */
	public List<RoleVo> getAllRoleVo() throws Exception;
	
	/**
	 * 
	 * @MethodName getRoles
	 * @Description 获得角色
	 * @author chengui
	 * @date 2013-5-31 上午9:43:29
	 * @param userVo
	 * @return List<Role>
	 * @throws Exception
	 */
	public List<Role> getRoles(UserVo userVo) throws Exception;
	
	/**
	 * 
	 * @MethodName allocateAccess
	 * @Description 分配权限
	 * @author chengui
	 * @date 2013-6-1 下午5:41:56
	 * @param roleVo
	 * @throws Exception
	 */
	public void allocateAccess(RoleVo roleVo) throws Exception;
	
	/**
	 * 
	 * @MethodName getRoleVos
	 * @Description 通过用户Vo获得角色Vo集合
	 * @author chengui
	 * @date 2013-6-5 下午5:04:29
	 * @param userVo
	 * @return List<RoleVo>
	 * @throws Exception
	 */
	public List<RoleVo> getRoleVos(UserVo userVo) throws Exception;
	
	/**
	 * 验证名称是否存在
	 * @param roleName
	 * @return
	 */
	public List<Role> roleList(String roleName);
	
	/**
	 * 验证角色编码是否存在
	 * @param roleCode
	 * @return
	 */
	public List<Role> roleListByRoleCode(String roleCode);

}
